//
//  UIButton+Extension.m
//  SinaBlog
//
//  Created by mac on 15/11/25.
//  Copyright © 2015年 ZZY. All rights reserved.
//

#import "UIButton+Extension.h"

@implementation UIButton (Extension)
-(void)initWithTitle:(NSString *)title color:(UIColor *)color fontSize:(CGFloat)fontSize backgroundImage:(NSString *)backgroundImage {
    
    [self setTitle:title forState:(UIControlStateNormal)];
    [self setTitleColor:color forState:(UIControlStateNormal)];
    
    self.titleLabel.font = [UIFont systemFontOfSize:fontSize];
    
    [self setBackgroundImage:[UIImage imageNamed:backgroundImage] forState:(UIControlStateNormal)];
    NSString *imageName = [NSString stringWithFormat:@"backgroundImage%@",@"_highlighted"];
    [self setBackgroundImage:[UIImage imageNamed:imageName] forState:(UIControlStateHighlighted)];
}

@end
